package pro.shushi.pamirs.hr.api.model.major;

import pro.shushi.pamirs.meta.annotation.Field;
import pro.shushi.pamirs.meta.annotation.Model;
import pro.shushi.pamirs.meta.base.IdModel;

/**
 * DictionaryItem 数据字典
 * @author shushi
 */
@Model.model(DictionaryItem.MODEL_MODEL)
@Model(displayName = "数据字典", labelFields = "dictName")
@Model.Advanced(unique = {"dictValue,typeCode"}, ordering = "sortNo")
public class DictionaryItem extends IdModel {

    private static final long serialVersionUID = -1L;

    public static final String MODEL_MODEL = "hr.simple.DictionaryItem";

    @Field(displayName = "字典编码", summary = "字典编码", required = true)
    private String dictValue;

    @Field(displayName = "字典名称", summary = "字典名称", required = true)
    private String dictName;

    @Field.many2one
    @Field.Relation(relationFields = {"typeCode"}, referenceFields = {"code"})
    @Field(displayName = "字典类型", required = true)
    private DictionaryType dictType;

    @Field(displayName = "字典类型编码", invisible = true)
    private String typeCode;

    @Field.Integer
    @Field(displayName = "顺序号")
    private Integer sortNo;

    @Field.String
    @Field(displayName = "备注", summary = "备注")
    private String remark;

}
